﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

public class RandomNumberExample
{
    public static void Main(string[] args)
    {
        var random = new Random();
        var numbers = Enumerable.Range(0, 100).Select(_ => random.Next(0, 1001)).ToList();

        var sortedNumbers = numbers.OrderByDescending(n => n).ToList();
        var sum = sortedNumbers.Sum();
        var average = sortedNumbers.Average();

        Console.WriteLine($"排序后的数字: {string.Join(", ", sortedNumbers)}");
        Console.WriteLine($"总和: {sum}, 平均值: {average}");
    }
}